#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
//查找数字7

void find_k(int arr[][3],int cow,int column ,int k)
{
	int x = 0;
	int y = column - 1;
	int flag = 0;
	while (x<=cow-1&&y>=0)
	{
		if (arr[x][y] > k)
		{
			y--;
		}
		else if (arr[x][y] < k)
		{
			x++;
		}
		else
		{
			printf("找到了，其下标为%d %d\n", x, y);
			flag = 1;
			break;
		}
	}
	if (1 != flag)
	{
		printf("没有找到\n");
	}

}
int main()
{
	int arr[][3] = {1,2,3,4,5,6,7,8,9};
	int k = 7;
	find_k(arr,3,3,k);
	return 0;
}